﻿Imports Microsoft.AspNet.SignalR
Imports Common

Public Class ChatHub
    Inherits Hub

    Public Sub Send(message As String)
        Clients.All.addMessage(message)
    End Sub

    Public Sub SendMessage(id As String, message As String)
        'Dim oPlayer As New BLL.Player
        Dim player As playerDTO = BLL.Players.getPlayerByGUID(id)
        Clients.All.addMessage(String.Format("{0}: {1}", player.Alias, message))

    End Sub

    Public Sub JoinGroup(groupName As String)
        Groups.Add(Context.ConnectionId, groupName)
    End Sub

    'Clients.Group("SilverlightApp").BroadcastToGroup(String.Format("SilverlightApp {0}", DateTime.Now))
End Class
